<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Settings
 *
 * @author kevinthant
 */
namespace Backuper;
class Settings {
    //put your code here
    
    //put your code here
    protected static $_instances = array();
    protected $options = array();
    
    protected function __construct(array $options) {
       
         $this->options = $options;
    }
    
    public function __get($name)
    {
        if(isset($this->options[$name])){
            return $this->options[$name];
        }
        
        
        return null;
    }
    
    public static function getInstance($options = null){
        
        $class = get_called_class();
        if(!isset(self::$_instances[$class])){
            
            self::$_instances[$class] = new $class($options);
        }
        
        return self::$_instances[$class];
    }
}


